@extends('/admin/Layout/layout')
@section('title','分类修改')
@section('content')

<div id="page-wrapper" >
	<div class="row">
	    <div class="col-lg-2">
	        <h1 class="page-header">分类修改</h1>
	    </div>
	    <!-- /.col-lg-12 -->
	</div>

	<div class='row'>
		 <div class="panel panel-default col-lg-8 col-lg-offset-2">
	        <div class="panel-body">
				<div class='row'>
					<div class="col-lg-10 col-lg-offset-1">
			        	<form role="form" action="{{asset('/admin/cate/update')}}"  method='post'>
			                <div class="form-group">
			                    <label>所属分类：</label>
			                    <select class="form-control" name="pid">
			                        <option value='0' @if($cat->pid == null) selected @endif disabled >顶级类</option>
			                        @foreach($cates as $k=>$v)
			                        <option value='{{$v->tid}}' @if($v->tid == $cat->pid) selected @endif disabled >{{$v->tname}}</option>
			                        @endforeach
			                    </select>
			                </div>
			                <div class="form-group">
			                    <label>分类名：</label>
			                    <input class="form-control"  required name="tname" type="text" value="{{$cat->tname}}">
			                </div>
			                <input type="hidden" name='tid' value="{{$cat->tid}}">
			                {{csrf_field()}}
			                <button type="submit" class="btn btn-primary">提交</button>
			                <button type="reset" class="btn btn-warning">重置</button>
			            </form>
			        </div>
			    </div>
			</div>
		</div>
	</div>
</div>
@endsection